﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace MenuSystem.Models
{
    public class FunctionsHere
    {
        public DataClasses1DataContext dc = new DataClasses1DataContext();

        //Given a cafe name, get the description of that cafe

        public String getCafeDescription(String _cafeName)
        {
            String d = "";
            int c = dc.GetCafeDescription(_cafeName, ref d);
            return d;
            /**IQueryable<String> c = from cafe in dc.Cafes
                                   where (cafe.Cafe_Name == "Prisms")
                                   select cafe.Description;
            return c;
             * */
        }


        //Get all cafe names in the cafe table
        public IQueryable<String> getAllCafeNames()
        {
            IQueryable<String> c = from cafe in dc.Cafes
                                   select cafe.Cafe_Name;
            return c;

        }

        //Get all building names in building table
        public IQueryable<String> getAllBuildingNames()
        {
            IQueryable<String> b = from building in dc.Buildings

                                   select building.Building_Name.ToString();
            return b;
        }

        //Get all fooditems
        public IQueryable<String> getFoodItems()
        {

            IQueryable<String> food = from foodItems in dc.FoodItems
                                      where foodItems.Cafe_ID == 10
                                      select foodItems.Name;
            return food;
        }
        //Get Food Description
        public IQueryable<String> getFoodDesc()
        {

            IQueryable<String> food = from foodItems in dc.FoodItems
                                      where foodItems.Cafe_ID == 10
                                      select foodItems.Description;
            return food;
        }
        //Get Cafe from building
        public IQueryable<String> getCafeName(String _BuildingName)
        {

            IQueryable<String> cafe = from Cafe in dc.Cafes
                                      where Cafe.Building_ID == 1
                                      select Cafe.Cafe_Name;
            return cafe;
        }
    }

}